﻿using System;
using System.Collections.Generic;

namespace nRoute.Components.Composition
{
    public interface IResourceCatalog
        : IServiceProvider
    {
        object GetResource(Type resourceType);

        T GetResource<T>();

        object GetResource(Type resourceType, string key);

        T GetResource<T>(string key);

        bool TryGetResource(Type resourceType, out object resourceInstance);

        bool TryGetResource<T>(out T resourceInstance);

        bool TryGetResource(Type resourceType, string key, out object resourceInstance);

        bool TryGetResource<T>(string key, out T resourceInstance);

        bool IsResourceable(Type resourceType);

        bool IsResourceable<T>();

        bool IsResourceable(Type resourceType, string key);

        bool IsResourceable<T>(string key);

        IEnumerable<Object> GetAllResources(Type resourceType);

        IEnumerable<T> GetAllResources<T>();
    }
}
